home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / langguid / chap_06 / xmpl_12.sx < prev   
Encoding:
Text File  |  1996-05-21  |  667 b   |  34 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Kaleida Labs, Inc.
  3. -- Field Guide to the ScriptX Language
  4. -- chapter 6, example 12
  5.  
  6. -- augmenting instance variables
  7.  
  8. class Person ()
  9.     instance variables _name
  10.     instance methods
  11.         method nameSetter self value -> (
  12.             if ((isaKindOf value String) == false) then
  13.                 print "bad value for IV name."
  14.             else self._name := value
  15.         )
  16. end
  17.  
  18.  
  19. class myRoundClass ()
  20.     instance variables _radius
  21.     instance methods
  22.         method set radius self value -> (
  23.             format debug "changing radius to %*" value @normal
  24.             self._radius := value
  25.         )
  26.         method get radius self -> (
  27.             format debug "The value of radius is %*" \
  28.             self._radius @normal
  29.         return self._radius
  30.         )
  31. end
  32.  
  33.  
  34. -->>>